package com.mouse.hxsj.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mouse.hxsj.entity.po.QqRole;
import com.mouse.hxsj.entity.po.mr.MrQqRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface QqRoleMapper extends BaseMapper<QqRole> {
//    @Select("select a.*,b.user_name qqAccountName,c.description gameAreaName from qq_role a " +
//            "left join qq_account b on b.id=a.qq_account_id " +
//            "left join game_area c on c.id=a.game_area_id " +
//            "where a.description like concat('%', #{description}, '%') " +
//            "and b.user_name like concat('%', #{qqAccountName}, '%') " +
//            "order by a.id")
    @Select("select a.*,b.user_name qqAccountName,c.description gameAreaName from qq_role a " +
            "left join qq_account b on b.id=a.qq_account_id " +
            "left join game_area c on c.id=a.game_area_id " +
            "where a.description like  #{description} " +
            "and b.user_name like #{qqAccountName} " +
            "order by a.id")
    List<MrQqRole> findAll(@Param("qqAccountName") String qqAccountName, @Param("description") String description);
}